//重置样式
require('../../assets/css/index.less')

//引入weui库
require('../../assets/lib/weui/weui.css')
let weui = require('../../assets/lib/weui/weui.js')
console.log(weui);

//当前页面样式
require('./startTraining.less')

//引入字体库
require('../../assets/fonts/iconfont.css')

//引入dom
const dom = require('../../utils/dom.js')

//引入https
const https = require('../../utils/https.js')




dom.reday(function () {
    // let flag = true
    //点击进入详情
    // dom.getEvent('#btn2', function () {
    //     dom.getEle('#playBtn').src='../../assets/imgs/24gf-play.png'
    //     // dom.getEle('.modal').style.display = 'block'
    //     if(flag){
    //         dom.getEle('#playBtn').src='../../assets/imgs/暂停.png'
    //     }else{
    //         dom.getEle('#playBtn').src='../../assets/imgs/24gf-play.png' 
    //     }
    //     flag=!flag
    // })

    // 获取id
    let id = location.search.slice(location.search.indexOf('=') + 1)

    https.get('/api/train/courseDetail?id='+id,function(res){
        let {errno,data} = res
        console.log(res);
        if(errno==0){
            dom.getEle('#num1').textContent=data.courseId
            dom.getEle('#num2').textContent=data.frequency
            dom.getEle('#title').textContent=data.fragments[0].title
        }
    })
})